﻿using AdminSystem.Applications;
using AdminSystem.Domain.User;
using AdminSystem.Write.API.Command.ShoppsCommand;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace AdminSystem.Write.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ShoppController : ControllerBase
    {
        public ShoppController(IMediator mediator)
        {
            Mediator = mediator;
        }

        public IMediator Mediator { get; }


        /// <summary>
        /// 查询商品
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<ApiResult<List<Shopp>>> GetShopp()
        {
            ShoppCommand command = new ShoppCommand();
            return await Mediator.Send(command);
        }
    }
}
